
#ifndef LOGGER_H_
#define LOGGER_H_


#include "status.hxx"
#include <stdio.h>
#include <sys/time.h>
#include <time.h>
#include <sys/types.h>
#include <unistd.h>
#include <errno.h>
#include <string>


class Logger {

private:
  FILE* m_file;
  std::string m_fname;
	

  static Logger* m_instance;
  

public:
  Logger(const std::string& fname) 
  : m_file(NULL), 
    m_fname(fname) { }
 
  ~Logger() {
	  fclose(m_file);
  }

  DbStatus open(); 

  static DbStatus init(const std::string& logFileName);

  static void log(const char* format, ...); 

  void DbLog(const char* format, va_list va); 
};


#endif  // LOGGER_H_
